package com.highper.common.interceptor;

import com.highper.common.constant.SchemaConstant;
import com.highper.common.constant.ServiceNameConstant;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author ZhangGJ
 * @Date 2022/02/10 15:16
 */
public class ServiceSchema {

    public static String schema(String route) {
        if (StringUtils.isEmpty(route)) {
            return null;
        }
        if (ServiceNameConstant.HIGHPER_GATEWAY.equals(route)) {
            return SchemaConstant.HIGHPER_GATEWAY;
        }
        if (ServiceNameConstant.HIGHPER_APPLICATION.equals(route)) {
            return SchemaConstant.HIGHPER_APPLICATION;
        }
        if (ServiceNameConstant.HIGHPER_ADMIN.equals(route)) {
            return SchemaConstant.HIGHPER_ADMIN;
        }
        if (ServiceNameConstant.HIGHPER_ACCOUNT.equals(route)) {
            return SchemaConstant.HIGHPER_ACCOUNT;
        }
        return route;
    }
}
